import React from "react";
// import { useState } from "react";
import { Navigate } from "react-router-dom";
let isLogin = true;

export default function RequireAuth(props) {
  //   const { isLogin, setIsLogin } = useState(true);
  return (
    <div>
      {/* {props.children} //插槽 */}
      {isLogin ? props.children : <Navigate to="/login"></Navigate>}
    </div>
  );
}
